# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsData do
  @moduledoc """
  The USPS data for the address. `uspsData` is not guaranteed to be fully populated for every US or PR address sent to the Address Validation API. It's recommended to integrate the backup address fields in the response if you utilize uspsData as the primary part of the response.

  ## Attributes

  *   `lacsLinkReturnCode` (*type:* `String.t`, *default:* `nil`) - LACSLink return code.
  *   `dpvNonDeliveryDaysValues` (*type:* `integer()`, *default:* `nil`) - Integer identifying non-delivery days. It can be interrogated using bit flags: 0x40 – Sunday is a non-delivery day 0x20 – Monday is a non-delivery day 0x10 – Tuesday is a non-delivery day 0x08 – Wednesday is a non-delivery day 0x04 – Thursday is a non-delivery day 0x02 – Friday is a non-delivery day 0x01 – Saturday is a non-delivery day
  *   `postOfficeState` (*type:* `String.t`, *default:* `nil`) - Main post office state.
  *   `errorMessage` (*type:* `String.t`, *default:* `nil`) - Error message for USPS data retrieval. This is populated when USPS processing is suspended because of the detection of artificially created addresses. The USPS data fields might not be populated when this error is present.
  *   `defaultAddress` (*type:* `boolean()`, *default:* `nil`) - Indicator that a default address was found, but more specific addresses exists.
  *   `suitelinkFootnote` (*type:* `String.t`, *default:* `nil`) - Footnotes from matching a street or highrise record to suite information. If business name match is found, the secondary number is returned. * `A`: SuiteLink record match, business address improved. * `00`: No match, business address is not improved.
  *   `abbreviatedCity` (*type:* `String.t`, *default:* `nil`) - Abbreviated city.
  *   `county` (*type:* `String.t`, *default:* `nil`) - County name.
  *   `pmbNumber` (*type:* `String.t`, *default:* `nil`) - PMB (Private Mail Box) number;
  *   `elotNumber` (*type:* `String.t`, *default:* `nil`) - Enhanced Line of Travel (eLOT) number.
  *   `deliveryPointCode` (*type:* `String.t`, *default:* `nil`) - 2 digit delivery point code
  *   `carrierRouteIndicator` (*type:* `String.t`, *default:* `nil`) - Carrier route rate sort indicator.
  *   `poBoxOnlyPostalCode` (*type:* `boolean()`, *default:* `nil`) - PO Box only postal code.
  *   `lacsLinkIndicator` (*type:* `String.t`, *default:* `nil`) - LACSLink indicator.
  *   `dpvEnhancedDeliveryCode` (*type:* `String.t`, *default:* `nil`) - Indicates that more than one DPV return code is valid for the address. Returns a single character. * `Y`: Address was DPV confirmed for primary and any secondary numbers. * `N`: Primary and any secondary number information failed to DPV confirm. * `S`: Address was DPV confirmed for the primary number only, and the secondary number information was present but not confirmed, or a single trailing alpha on a primary number was dropped to make a DPV match and secondary information required. * `D`: Address was DPV confirmed for the primary number only, and the secondary number information was missing. * `R`: Address confirmed but assigned to phantom route R777 and R779 and USPS delivery is not provided.
  *   `dpvCmra` (*type:* `String.t`, *default:* `nil`) - Indicates if the address is a CMRA (Commercial Mail Receiving Agency)--a private business receiving mail for clients. Returns a single character. * `Y`: The address is a CMRA * `N`: The address is not a CMRA
  *   `postOfficeCity` (*type:* `String.t`, *default:* `nil`) - Main post office city.
  *   `carrierRoute` (*type:* `String.t`, *default:* `nil`) - The carrier route code. A four character code consisting of a one letter prefix and a three digit route designator. Prefixes: * `C`: Carrier route (or city route) * `R`: Rural route * `H`: Highway Contract Route * `B`: Post Office Box Section * `G`: General delivery unit
  *   `fipsCountyCode` (*type:* `String.t`, *default:* `nil`) - FIPS county code.
  *   `dpvFootnote` (*type:* `String.t`, *default:* `nil`) - The footnotes from delivery point validation. Multiple footnotes may be strung together in the same string. * `AA`: Input address matched to the ZIP+4 file * `A1`: Input address was not matched to the ZIP+4 file * `BB`: Matched to DPV (all components) * `CC`: Secondary number not matched and not required * `C1`: Secondary number not matched but required * `N1`: High-rise address missing secondary number * `M1`: Primary number missing * `M3`: Primary number invalid * `P1`: Input address PO, RR or HC box number missing * `P3`: Input address PO, RR, or HC Box number invalid * `F1`: Input address matched to a military address * `G1`: Input address matched to a general delivery address * `U1`: Input address matched to a unique ZIP code * `PB`: Input address matched to PBSA record * `RR`: DPV confirmed address with PMB information * `R1`: DPV confirmed address without PMB information * `R7`: Carrier Route R777 or R779 record * `IA`: Informed Address identified * `TA`: Primary number matched by dropping a trailing alpha
  *   `dpvConfirmation` (*type:* `String.t`, *default:* `nil`) - The possible values for DPV confirmation. Returns a single character or returns no value. * `N`: Primary and any secondary number information failed to DPV confirm. * `D`: Address was DPV confirmed for the primary number only, and the secondary number information was missing. * `S`: Address was DPV confirmed for the primary number only, and the secondary number information was present but not confirmed. * `Y`: Address was DPV confirmed for primary and any secondary numbers. * Empty: If the response does not contain a `dpv_confirmation` value, the address was not submitted for DPV confirmation.
  *   `dpvNonDeliveryDays` (*type:* `String.t`, *default:* `nil`) - Flag indicates mail delivery is not performed every day of the week. Returns a single character. * `Y`: The mail delivery is not performed every day of the week. * `N`: No indication the mail delivery is not performed every day of the week.
  *   `dpvPbsa` (*type:* `String.t`, *default:* `nil`) - Indicates the address was matched to PBSA record. Returns a single character. * `Y`: The address was matched to PBSA record. * `N`: The address was not matched to PBSA record.
  *   `dpvNoStat` (*type:* `String.t`, *default:* `nil`) - Is this a no stat address or an active address? No stat addresses are ones which are not continuously occupied or addresses that the USPS does not service. Returns a single character. * `Y`: The address is not active * `N`: The address is active
  *   `standardizedAddress` (*type:* `GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress.t`, *default:* `nil`) - USPS standardized address.
  *   `addressRecordType` (*type:* `String.t`, *default:* `nil`) - Type of the address record that matches the input address. * `F`: FIRM. This is a match to a Firm Record, which is the finest level of match available for an address. * `G`: GENERAL DELIVERY. This is a match to a General Delivery record. * `H`: BUILDING / APARTMENT. This is a match to a Building or Apartment record. * `P`: POST OFFICE BOX. This is a match to a Post Office Box. * `R`: RURAL ROUTE or HIGHWAY CONTRACT: This is a match to either a Rural Route or a Highway Contract record, both of which may have associated Box Number ranges. * `S`: STREET RECORD: This is a match to a Street record containing a valid primary number range.
  *   `cassProcessed` (*type:* `boolean()`, *default:* `nil`) - Indicator that the request has been CASS processed.
  *   `dpvDoorNotAccessible` (*type:* `String.t`, *default:* `nil`) - Flag indicates addresses where USPS cannot knock on a door to deliver mail. Returns a single character. * `Y`: The door is not accessible. * `N`: No indication the door is not accessible.
  *   `dpvVacant` (*type:* `String.t`, *default:* `nil`) - Is this place vacant? Returns a single character. * `Y`: The address is vacant * `N`: The address is not vacant
  *   `dpvThrowback` (*type:* `String.t`, *default:* `nil`) - Indicates that mail is not delivered to the street address. Returns a single character. * `Y`: The mail is not delivered to the street address. * `N`: The mail is delivered to the street address.
  *   `elotFlag` (*type:* `String.t`, *default:* `nil`) - eLOT Ascending/Descending Flag (A/D).
  *   `dpvNoStatReasonCode` (*type:* `integer()`, *default:* `nil`) - Indicates the NoStat type. Returns a reason code as int. * `1`: IDA (Internal Drop Address) – Addresses that do not receive mail directly from the USPS but are delivered to a drop address that services them. * `2`: CDS - Addresses that have not yet become deliverable. For example, a new subdivision where lots and primary numbers have been determined, but no structure exists yet for occupancy. * `3`: Collision - Addresses that do not actually DPV confirm. * `4`: CMZ (College, Military and Other Types) - ZIP + 4 records USPS has incorporated into the data. * `5`: Regular - Indicates addresses not receiving delivery and the addresses are not counted as possible deliveries. * `6`: Secondary Required - The address requires secondary information.
  *   `ewsNoMatch` (*type:* `boolean()`, *default:* `nil`) - The delivery address is matchable, but the EWS file indicates that an exact match will be available soon.
  *   `dpvNoSecureLocation` (*type:* `String.t`, *default:* `nil`) - Flag indicates door is accessible, but package will not be left due to security concerns. Returns a single character. * `Y`: The package will not be left due to security concerns. * `N`: No indication the package will not be left due to security concerns.
  *   `pmbDesignator` (*type:* `String.t`, *default:* `nil`) - PMB (Private Mail Box) unit designator.
  *   `deliveryPointCheckDigit` (*type:* `String.t`, *default:* `nil`) - The delivery point check digit. This number is added to the end of the delivery_point_barcode for mechanically scanned mail. Adding all the digits of the delivery_point_barcode, delivery_point_check_digit, postal code, and ZIP+4 together should yield a number divisible by 10.
  *   `dpvDrop` (*type:* `String.t`, *default:* `nil`) - Flag indicates mail is delivered to a single receptable at a site. Returns a single character. * `Y`: The mail is delivered to a single receptable at a site. * `N`: The mail is not delivered to a single receptable at a site.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :lacsLinkReturnCode => String.t() | nil,
          :dpvNonDeliveryDaysValues => integer() | nil,
          :postOfficeState => String.t() | nil,
          :errorMessage => String.t() | nil,
          :defaultAddress => boolean() | nil,
          :suitelinkFootnote => String.t() | nil,
          :abbreviatedCity => String.t() | nil,
          :county => String.t() | nil,
          :pmbNumber => String.t() | nil,
          :elotNumber => String.t() | nil,
          :deliveryPointCode => String.t() | nil,
          :carrierRouteIndicator => String.t() | nil,
          :poBoxOnlyPostalCode => boolean() | nil,
          :lacsLinkIndicator => String.t() | nil,
          :dpvEnhancedDeliveryCode => String.t() | nil,
          :dpvCmra => String.t() | nil,
          :postOfficeCity => String.t() | nil,
          :carrierRoute => String.t() | nil,
          :fipsCountyCode => String.t() | nil,
          :dpvFootnote => String.t() | nil,
          :dpvConfirmation => String.t() | nil,
          :dpvNonDeliveryDays => String.t() | nil,
          :dpvPbsa => String.t() | nil,
          :dpvNoStat => String.t() | nil,
          :standardizedAddress =>
            GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress.t()
            | nil,
          :addressRecordType => String.t() | nil,
          :cassProcessed => boolean() | nil,
          :dpvDoorNotAccessible => String.t() | nil,
          :dpvVacant => String.t() | nil,
          :dpvThrowback => String.t() | nil,
          :elotFlag => String.t() | nil,
          :dpvNoStatReasonCode => integer() | nil,
          :ewsNoMatch => boolean() | nil,
          :dpvNoSecureLocation => String.t() | nil,
          :pmbDesignator => String.t() | nil,
          :deliveryPointCheckDigit => String.t() | nil,
          :dpvDrop => String.t() | nil
        }

  field(:lacsLinkReturnCode)
  field(:dpvNonDeliveryDaysValues)
  field(:postOfficeState)
  field(:errorMessage)
  field(:defaultAddress)
  field(:suitelinkFootnote)
  field(:abbreviatedCity)
  field(:county)
  field(:pmbNumber)
  field(:elotNumber)
  field(:deliveryPointCode)
  field(:carrierRouteIndicator)
  field(:poBoxOnlyPostalCode)
  field(:lacsLinkIndicator)
  field(:dpvEnhancedDeliveryCode)
  field(:dpvCmra)
  field(:postOfficeCity)
  field(:carrierRoute)
  field(:fipsCountyCode)
  field(:dpvFootnote)
  field(:dpvConfirmation)
  field(:dpvNonDeliveryDays)
  field(:dpvPbsa)
  field(:dpvNoStat)

  field(:standardizedAddress,
    as: GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsAddress
  )

  field(:addressRecordType)
  field(:cassProcessed)
  field(:dpvDoorNotAccessible)
  field(:dpvVacant)
  field(:dpvThrowback)
  field(:elotFlag)
  field(:dpvNoStatReasonCode)
  field(:ewsNoMatch)
  field(:dpvNoSecureLocation)
  field(:pmbDesignator)
  field(:deliveryPointCheckDigit)
  field(:dpvDrop)
end

defimpl Poison.Decoder,
  for: GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsData do
  def decode(value, options) do
    GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsData.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AddressValidation.V1.Model.GoogleMapsAddressvalidationV1UspsData do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
